#TODO:
##Help screen info
##Death screen
##More items and monsters
##AI fine tuning (make it smarter)
##Story and goal
##Show more stats when monsters are examined
##Do something with use command

#Recent Changes:
##7/1/10
###+Examining monsters now shows their stats
##6/26/10
###*Changed how objects know when to be updated (only when the player moves)
###+Monsters/Items now have a minimum depth at which they can spawn
###+Items now change stats when equipped
###+Items now have a requirement based on level
##6/17/10
###*Can only equip one of each type (except rings)
###*Changed the pathfinding for monsters
##6/15/10
###+Help screen
###+Inventory (pick up, drop, equip, unequip)
###+Dialog verb endings
###*Changed when objects are updated (only updated when told to do so)
##6/14/10
###+Changelog added
###+Monster AI
###+Item and monster spawning
###+Dialog system

import libtcodpy as libtcod
import ConfigParser
import utils
from game import Game

def init():
    #Read Settings
    settings = ConfigParser.ConfigParser()
    settings.read(utils.FILES['settings'])
    
    SKIP_CREDITS = settings.getboolean('SETTINGS', 'skip_credits')
    FULLSCREEN = settings.getboolean('SETTINGS', 'fullscreen')
    FONTFILE = 'fonts/' + settings.get('SETTINGS', 'font')
    FONTFLAGS = settings.getint('SETTINGS', 'fontflags')
    RENDER_TYPE = settings.getint('SETTINGS', 'render_type')
    
    #Apply Settings
    libtcod.console_set_custom_font(FONTFILE, FONTFLAGS)
    libtcod.console_init_root(utils.SCREEN_WIDTH, utils.SCREEN_HEIGHT, utils.WINDOW_TITLE, FULLSCREEN, RENDER_TYPE)
    libtcod.sys_set_fps(utils.TARGET_FPS)
    libtcod.console_set_keyboard_repeat(175, 30)
    
    if not SKIP_CREDITS:
        libtcod.console_credits()
    libtcod.console_set_foreground_color(0, utils.COLORS['FCOL'])
    libtcod.console_set_background_color(0, utils.COLORS['BCOL'])

if __name__ == "__main__":
    init()
    game = Game()
    game.loop()
    game.end()
